﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DQYT.HTDZ.Model;
using System.Data;

namespace DQYT.HTDZ.IDAL
{
    public interface IBDUser
    {
        #region  Method

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        bool Exists(int USE_ID);


        /// <summary>
        /// 增加一条数据
        /// </summary>
        bool Add(BDUserModel model);
        /// <summary>
        /// 更新一条数据
        /// </summary>
        bool Update(BDUserModel model);
            

        /// <summary>
        /// 删除一条数据
        /// </summary>
        bool Delete(int USE_ID);
        
        /// <summary>
        /// 批量删除数据
        /// </summary>
        bool DeleteList(string USE_IDlist);

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        BDUserModel GetModel(int USE_ID);

        BDUserModel GetModel(string USE_CODE);

        /// <summary>
        /// 获得数据列表
        /// </summary>
        DataSet GetList(string strWhere);

        /// <summary>
        /// 获取记录总数
        /// </summary>
        int GetRecordCount(string strWhere);
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex);

        #endregion  Method

        #region 新添加
        /// <summary>
        /// 判断用户名密码
        /// </summary>
        /// <param name="UserCode">用户代码</param>
        /// <param name="Pwd">登录密码</param>
        /// <returns>1为成功，0为密码错误，-1用户名错误</returns>
        int CheckUserAndPwd(string UserCode, string Pwd);

        /// <summary>
        /// 更新密码
        /// </summary>
        /// <param name="USE_ID">用户ID</param>
        /// <param name="Pwd">用户密码</param>
        /// <returns></returns>
        bool UpdatePwd(int USE_ID, string Pwd);

        /// <summary>
        /// 获得查询结果
        /// </summary>
        /// <param name="strWhere">查询条件 from userinfo u,jiaose j,bumen b</param>
        /// <returns>select u.*,b.bum_mc,j.jse_name</returns>
        DataTable GetBendData(string strWhere);

        /// <summary>
        /// 检查用户代码是否存在
        /// </summary>
        /// <param name="USE_CODE">用户代码</param>
        /// <returns></returns>
        bool CheckCode(string USE_CODE);

        /// <summary>
        /// 检查用户代码是否存在
        /// </summary>
        /// <param name="USE_CODE">用户代码</param>
        /// <param name="Cur_USE_ID">当前用户ID</param>
        /// <returns></returns>
        bool CheckCode(string USE_CODE, string Cur_USE_ID);

        /// <summary>
        /// 获得下一个ID
        /// </summary>
        /// <returns></returns>
        int GetNextID();

        /// <summary>
        /// 验证用户
        /// </summary>
        /// <param name="USE_ID">用户ID</param>
        /// <param name="MNU_ID">菜单ID</param>
        /// <returns></returns>
        bool VerifyUser(int USE_ID, int MNU_ID);

        /// <summary>
        /// 获得用户列表
        /// </summary>
        /// <param name="JiaoSe">较色名</param>
        /// <returns></returns>
        DataTable GetUserList(string JiaoSe);

        #endregion
    }
}
